{% extends "printables_list.html" %}
{% load i18n %}

{% block head-title %}
  {% trans "Feedback Forms" %}
{% endblock %}
{% block page-title %}{% blocktrans trimmed with round=round.name %}
Printable Feedback Forms for {{ round }}
{% endblocktrans %}{% endblock %}

{% block page-alerts %}
  {% if not team_questions_exist or not adj_questions_exist %}
    {% if not team_questions_exist and not adj_questions_exist %}
      {% trans "No feedback questions have been added for either teams or adjudicators to answer." as first_sentence %}
    {% elif not team_questions_exist %}
      {% trans "No feedback questions have been added for teams to answer." as first_sentence %}
    {% elif not adj_questions_exist %}
      {% trans "No feedback questions have been added for adjudicators to answer." as first_sentence %}
    {% endif %}
    {% blocktrans trimmed asvar message %}
      {{ first_sentence }}
      Check the <a href="http://tabbycat.readthedocs.io/en/stable/features/adjudicator-feedback.html" target="_blank">documentation</a> for information on how to add these (otherwise these forms will be quite bare).
    {% endblocktrans %}
    {% include "components/alert.html" with type="warning" %}
  {% endif %}
  {{ block.super }}
{% endblock %}

{% block content %}

  <div id="vueMount">
    <template v-for="ballot in ballots">
      <div class="db-page-holder">
        <main role="main" class="db-page db-flex-column db-page-portrait">
          <printable-ballot :ballot="ballot" :kind="'Feedback'"
                            :round-info="roundInfo"></printable-ballot>
        </main>
      </div>
    </template>
    <div v-if="ballots.length === 0" class="alert alert-warning">
      {% trans "There are no feedback sheets available — perhaps adjudicators have not been allocated?" %}
    </div>
  </div>

{% endblock content %}

{% block js %}
  <style>
    @media print {
      @page {
        size: portrait;
      }
    }
  </style>
  <script>
    window.vueData = {
      // Strings to Fill In
      roundInfo: {
        tournamentName: '{{ tournament.short_name }}',
        returnLocation: '{{ pref.feedback_return_location }}',
        // Formatting
        showTabRoomRow: true,
        // From Django
        round: '{{ round.abbreviation }}',
        questions: {{ questions|safe }},
        motions: [],
      },
      ballots: {{ ballots|safe }},
    }
  </script>
  {{ block.super }}

{% endblock js %}
